package com.ucode.model.hrm.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalTime;

@Schema(description = "人力资源管理系统 - 打开配置Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmAttendanceConfigForm {
    /**
     * 配置标题
     */
    @Schema(description = "配置标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "配置标题不能为空")
    @Size(max = 100, message = "配置标题不能超过 100 个字符")
    private String title;
    /**
     * 上班时间
     */
    @Schema(description = "上班时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "上班时间不能为空")
    private LocalTime clockInTime;
    /**
     * 上班打卡截止时间
     */
    @Schema(description = "上班打卡截止时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "上班打卡截止时间不能为空")
    private LocalTime clockInEndTime;

    /**
     * 下班时间
     */
    @Schema(description = "下班时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "下班时间不能为空")
    private LocalTime clockOutTime;
    /**
     * 下班打卡截止时间
     */
    @Schema(description = "下班打卡截止时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "下班打卡截止时间不能为空")
    private LocalTime clockOutEndTime;

    /**
     * 打卡地点（GPS坐标或地址）
     */
    @Schema(description = "打卡地点", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "打卡地点不能为空")
    @Size(max = 100, message = "打卡地点不能超过 100 个字符")
    private String location;
    /**
     * 打卡点纬度
     */
    @Schema(description = "打卡点纬度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "打卡点纬度不能为空")
    private BigDecimal locationLat;
    /**
     * 打卡点经度
     */
    @Schema(description = "打卡点经度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "打卡点经度不能为空")
    private BigDecimal locationLng;
    /**
     * 允许打卡半径（单位：米）
     */
    @Schema(description = "允许打卡半径", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "允许打卡半径不能为空")
    private Integer allowRadius;
    /**
     * 迟到阈值(分钟)
     */
    @Schema(description = "迟到阈值", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "迟到阈值不能为空")
    private Integer lateThreshold;
    /**
     * 早退阈值(分钟)
     */
    @Schema(description = "早退阈值", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "早退阈值不能为空")
    private Integer earlyLeaveThreshold;
}
